/**
 * 
 */

var toolbar;

function doOnLoad() {
	toolbar = new dhtmlXToolbarObject({
		parent:'toolbarDiv',
		icons_path: contextPath + "/resources/imgs/icons_web/"
	});
	
	var newOpts = Array(	Array('new_text', 'obj', 'Text Document', 'text_document.gif'),
			Array('new_excel','obj', 'Stylesheet'   , 'stylesheet.gif'),
			Array('new_db',   'obj', 'Database'     , 'database.gif'),
			Array('new_pp',   'obj', 'Presentation' , 'presentation.gif'),
			Array('new_s1',   'sep'),
			Array('new_other','obj', 'Other'        , 'other.gif'));

	toolbar.addButtonSelect("new", 0, "New", newOpts, "new.gif", "new_dis.gif");
	toolbar.addSeparator("sep1", 1);
	toolbar.addButton("open", 2, "", "open.gif", "open_dis.gif");
	toolbar.addButton("save", 3, "", "save.gif", "save_dis.gif");
	toolbar.addButton("save_as", 4, "Save As...", "save_as.gif", "save_as_dis.gif");
	toolbar.disableItem("save_as");
	toolbar.addSeparator("sep2", 5);
	toolbar.addButton("undo", 6, "", "undo.gif", "undo_dis.gif");
	toolbar.addButton("redo", 7, "", "redo.gif", "redo_dis.gif");
	toolbar.addSeparator("sep3", 8);
	toolbar.addButton("cut", 9, "Cut", "cut.gif", "cut_dis.gif");
	toolbar.addButton("copy", 10, "Copy", "copy.gif", "copy_dis.gif");
	toolbar.addButton("paste", 11, "Paste", "paste.gif", "paste_dis.gif");
	toolbar.addSeparator("sep4", 12);

	var printOpts = Array(	Array('print_page', 'obj', 'Page'       , 'page.gif'),
			Array('print_range','obj', 'Page Range' , 'page_range.gif'),
			Array('print_sel',  'obj', 'Selection'  , 'selection.gif'),
			Array('print_sep1', 'sep'),
			Array('print_cfg',  'obj', 'Settings'   , 'settings.gif'));

	toolbar.addButtonSelect("print", 13, "Print", printOpts, "print.gif", "print_dis.gif");

	
	formData = [
	            {type: "settings", position: "label-left", labelWidth: 120, inputWidth: 120},
	            {type: "block", width:"1035", className:"clientBlock", 
	            	list: [
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "customer_code", label: "고객", readonly: true, required: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "input", name: "customer_name", readonly: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "button", name: "button_customer", value: "선택"}
	            	    	         ]
	            	       },
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "manager_code", label: "관리국", readonly: true, required: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "input", name: "manager_name", readonly: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "button", name: "button_manager", value: "선택"},
	            	    	         {type: "newcolumn", offset: 20},
	            	    	         {type: "input", name: "operator_code", label: "운용국", readonly: true, required: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "input", name: "operator_name", readonly: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "button", name: "button_operator", value: "선택"}
	            	    	         ]
	            	       },
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "client_name", label: "수리의뢰자", width: 302, required: true},
	            	    	         {type: "newcolumn", offset: 20},
	            	    	         {type: "input", name: "client_phone", label: "수리의뢰자 연락처", width: 302},
	            	    	         ]
	            	       },
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "client_email", label: "수리의뢰자 E-MAIL", width: 302},
	            	    	         ]
	            	       }
	            	       ]
	            },
	            {type: "block", width:"1035", className:"orderBlock", 
	            	list: [
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "repair_order_no", label: "Repair Order No", width:302, readonly: true, required: true},
	            	    	         {type: "newcolumn", offset: 20},
	            	    	         {type: "calendar", name: "repair_date", label:"수리의뢰일", readonly: true, required: true}
	            	    	         ]
	            	       },
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "repair_type", label: "수리 유형", readonly: true, required: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "input", name: "repair_desc", readonly: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "button", name: "button_repair", value: "선택"},
	            	    	         {type: "newcolumn", offset: 20},
	            	    	         {type: "input", name: "depart_code", label: "접수 부서", readonly: true, required: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "input", name: "depart_name", readonly: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "button", name: "button_depart", value: "선택"}
	            	    	         ]
	            	       },
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "project_type", label: "프로젝트 구분", readonly: true, required: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "input", name: "project_desc", readonly: true},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "button", name: "button_project", value: "선택"},
	            	    	         ]
	            	       },
	            	       {type: "block", width:"100%", 
	            	    	   list:[
	            	    	         {type: "input", name: "serial_no", label: "Serial No.", width: 302, required: true},
	            	    	         {type: "newcolumn", offset: 20},
	            	    	         {type: "label", className: "plainLab", label: "택배 사용 여부"},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "radio", name: "delivery_use", value: "yes", label: "사용", labelAlign:"right"},
	            	    	         {type: "newcolumn"},
	            	    	         {type: "radio", name: "delivery_use", value: "no", label: "미사용", labelAlign: "right", checked: true},
	            	    	         ]
	            	       },
            	       ]
	            }
	           ];
	
	mainForm = new dhtmlXForm("contentDiv", formData);
	
	parent.progressOff();
};